#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
    pid_t ret = fork();
    printf("发生了神么事\n");
    while(1)
    {
    if(ret > 0)
    {
        printf("我是父进程,pid=%d,ppid=%d\n",getpid(),getppid());
        sleep(5);
    }
    else if(ret == 0)
    {
        printf("我是子进程,pid=%d,ppid=%d\n",getpid(),getppid());
        sleep(5);
    }
    }
    return 0;   
}
